import { BaseEntity } from '@cool-midway/core';
import { Column, Entity } from 'typeorm';

@Entity('dr_orders') // 可以指定表名，不指定会根据类名自己生成
export class OrdersEntity extends BaseEntity {
  @Column()
  order_number: string = null;

  @Column({
    nullable: false,
  })
  parent_order_number: string;

  @Column({
    nullable: false,
  })
  product_name: string;

  @Column({
    nullable: false,
  })
  product_id: string;

  @Column({
    nullable: false,
  })
  product_code: string;

  @Column({
    nullable: false,
  })
  product_quantity: number;

  @Column({
    nullable: false,
  })
  product_specification: number;

  @Column({
    nullable: false,
  })
  product_unit: string;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  order_payable_amount: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  merchant_price_change: number;

  @Column({
    nullable: false,
  })
  order_submission_time: string;

  @Column({
    nullable: false,
  })
  status: string;

  @Column({
    nullable: false,
  })
  traffic_genres: string;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  actual_platform_discount: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  actual_discounts_for_influencer: number;

  @Column({
    nullable: false,
    type: 'decimal',
    precision: 20,
    scale: 10,
  })
  actual_discount_amount_by_merchant: number;

  @Column({
    nullable: false,
  })
  store_name: string;

  @Column({
    nullable: false,
    type: 'date',
  })
  data_date: string;
}
